import Layout from '@/layout'

/**
 * 动态路由，基于用户权限动态去加载
 当某个菜单页面下有按钮点击跳转到某个页面，但是这个页面不在菜单中展示，
 这时无法在菜单管理加上这个菜单，因为该菜单是在左侧不显示的，不显示就无法匹配路由
 需要定义在该文件下，定义路由，权限可以根据自己或新增该菜单的按钮
 注意：这里定义的顶级不能和菜单管理的有重复
 */
export default [
  {
    path: '/system/admin-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:admin:auth-role'],
    children: [
      {
        path: 'role/:adminId(\\d+)',
        component: () => import('@/views/system/admin/authRole'),
        name: 'AuthRole',
        meta: { title: '分配角色', activeMenu: '/system/admin' }
      }
    ]
  },
  {
    path: '/system/role-auth',
    component: Layout,
    hidden: true,
    permissions: ['system:role:auth-list'],
    children: [
      {
        path: 'user/:roleId(\\d+)',
        component: () => import('@/views/system/role/user'),
        name: 'AuthUser',
        meta: { title: '分配用户', activeMenu: '/system/role' }
      }
    ]
  },
  {
    path: '/system/dict-data',
    component: Layout,
    hidden: true,
    permissions: ['system:dict-type:list'],
    children: [
      {
        path: 'index/:dictId(\\d+)',
        component: () => import('@/views/system/dict/data'),
        name: 'DictData',
        meta: { title: '字典数据', activeMenu: '/system/dict' }
      }
    ]
  }
]
